<?php 

/**
 * Error handler & logger
 */

set_error_handler ("dm_error_handler");

function dm_error_handler($code, $msg, $file, $line) {
	echo '<br><br>code: '.$code.'<br>message: '.$msg.'<br>file: '.$file.'<br>line: '.$line.'<br><br>';
}

class DM_Error {
	var $class;
	var $method;
	var $debugData;
	
	public function __construct( $string ) {
		$this->class = get_called_class();
		$this->method = __METHOD__;
		$this->debugData = debug_backtrace();
		throw new Exception( $string );
	}
}

?>